// 通过类型断言，明确告诉编译器该数据的类型

let data1: any = '要来一发吗?满足你'
let dataLength: number = data1.length
console.log(dataLength);

// 方式一：尖括号
let data2: any = '沧海桑田,唯混沌与破烂源源不断'
let data2Length: number = (<string>data2).length //不加括号报错
console.log(data2Length);

// 方式二： 使用关键字 as
let data3: any = '检测了对面的智商，嘿嘿嘿，看来无法发挥全部实力啦'
let data3Length: number = (data3 as string).length
